package com.glenet.salary.action;

import java.util.List;

import com.glenet.salary.dao.HrEmployeeJobDao;
import com.glenet.salary.entities.HrEmployeeJob;

/**
 * @author MeiWenhui
 * 
 */
@SuppressWarnings("serial")
public class EmployeeJobAction extends BaseAction {

	private HrEmployeeJob empJob;
	private Long id;
	// dao
	private HrEmployeeJobDao empJobDao = new HrEmployeeJobDao();
	
	

	public String add() {
		return SUCCESS;
	}

	public String execute() throws Exception {
		List<HrEmployeeJob> empJobs = empJobDao.list(offset, limit);
		req.setAttribute("empJobs", empJobs);
		return SUCCESS;
	}
	public String save() {
		return SUCCESS;
	}
	
	public String get(){
		empJob = empJobDao.get(id);
		return SUCCESS;
	}
	
	public String edit(){
		empJob = empJobDao.get(id);
		return SUCCESS;
	}
	
	public String update(){
		System.out.println(empJobDao.update(empJob));
		return SUCCESS;
	}
	
	public String delete(){
		return SUCCESS;
	}

	public HrEmployeeJob getEmpJob() {
		return empJob;
	}

	public void setEmpJob(HrEmployeeJob empJob) {
		this.empJob = empJob;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}
